
<template>
    <div>
        <router-link to="/SpareDOA" style="float: right">
            <el-button type="danger" icon="close" size="mini" class="bolder outsideBtnBS"></el-button>
        </router-link>
        <label class="default-label" v-text="nowLangue.addSpareDOA"></label>
        <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.saveAndSubmit"></el-button>
        <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.save"></el-button>
        <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.cancel"></el-button>
        <!--新建备件DOA-->
        <el-form :inline="true" :model="addSpareDOAForm" class="demo-form-inline label-minW95" style="border-bottom:1px solid #ccc;" >
                <!--DOA备案号-->
                <el-form-item :label="nowLangue.DOAcode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--备案人员-->
                <el-form-item :label="nowLangue.recorder">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--备案时间-->
                <el-form-item :label="nowLangue.recordTime">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--网点编码-->
                <el-form-item :label="nowLangue.dotCode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--维修网点名称-->
                <el-form-item :label="nowLangue.repairDotName">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--备件条码-->
                <el-form-item :label="nowLangue.spareBarCode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--备件编码-->
                <el-form-item :label="nowLangue.spareCode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--备件名称-->
                <el-form-item :label="nowLangue.spareName">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--备件小类-->
                <el-form-item :label="nowLangue.spareClass">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--计划大类-->
                <el-form-item :label="nowLangue.planClass">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--产品线-->
                <el-form-item :label="nowLangue.productLine">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--维修单号-->
                <el-form-item :label="nowLangue.repairCode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--主机型号-->
                <el-form-item :label="nowLangue.hostModel">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--借用单号-->
                <el-form-item :label="nowLangue.lendCode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--DOA类型-->
                <el-form-item :label="nowLangue.DOAtype">
                    <el-select size="mini" clearable :placeholder="nowLangue.pleaseImport" v-model="addSpareDOAForm.subClassCode">
                        <el-option>外观</el-option>
                        <el-option>电性能</el-option>
                    </el-select>
                </el-form-item>
                <!--故障编码-->
                <el-form-item :label="nowLangue.faultCode">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--故障名称-->
                <el-form-item :label="nowLangue.faultName">
                    <el-input v-model="addSpareDOAForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--情况说明-->
                <p>
                    <el-form-item :label="nowLangue.conditionDescribe" class="selectMB10 default-flex">
                        <el-input type="textarea" resize="none" v-model="addSpareDOAForm.code"></el-input>
                    </el-form-item>
                </p>
            </el-form>
        <!--DOA复测步骤-->
        <label class="default-label" v-text="nowLangue.DOAretest"></label>
        <el-table :data="DOAretestData" border style="width: 100%;">
            <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
            <!--步骤标题-->
            <el-table-column prop="" :label="nowLangue.stepTitle" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--步骤说明-->
            <el-table-column prop="" :label="nowLangue.stepDescribe" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--复测结果-->
            <el-table-column prop="" :label="nowLangue.retestResult" header-align="center" show-overflow-tooltip width="180">
                <template scope="scope">
                    <el-select size="mini" :placeholder="nowLangue.pleaseSelect">
                        <el-option>是</el-option>
                        <el-option>否</el-option>
                    </el-select>
                </template>
            </el-table-column>
            <!--复测说明-->
            <el-table-column prop="" :label="nowLangue.retestDescribe" header-align="center" show-overflow-tooltip width="180">
                <template scope="scope">
                    <el-input size="mini" :placeholder="nowLangue.pleaseSelect"></el-input>
                </template>
            </el-table-column>
        </el-table>
        <!--DOA外观图片-->
        <label class="default-label" v-text="nowLangue.DOAappearImage"></label>
        <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.uploadImage"><!--上传图片--></el-button>
        <el-table :data="DOAimageData" border style="width: 100%;">
            <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
            <!--操作-->
            <el-table-column :label="nowLangue.operate" header-align="center" align="center" width="50">
                <template scope="scope">
                    <!--删除-->
                    <div class="operationItem bolder" v-text="nowLangue.delete"></div>
                </template>
            </el-table-column>
            <!--图片名称-->
            <el-table-column prop="" :label="nowLangue.imageName" header-align="center"  show-overflow-tooltip></el-table-column>
        </el-table>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                nowLangue:{},
                languageScoped:{
                    zh:{
                        "pleaseSelect":"请选择",
                        "pleaseImport":"请输入",
                        "spareCode":"备件编码",
                        "spareName":"备件名称",
                        "spareBarCode":"备件条码",
                        "sequence":"序",
                        "operate":"操作",
                        "status":"状态",
                        "signTime":"签收时间",
                        "dotCode":"网点编码",
                        "dotName":"网点名称",
                        "lendOrderCode":"借用订单号",
                        "repairOrderCode":"维修订单号",
                        "spareLendDetail":"备件借用明细",
                        "DOAkeep":"DOA备案",
                        "planClass":"计划大类",
                        "productLine":"产品线",
                        "spareClass":"备件小类",
                        "addSpareDOA":"新建备件DOA备案",
                        "DOAcode":"DOA备案号",
                        "recorder":"备案人员",
                        "recordTime":"备案时间",
                        "repairDotName":"维修网点名称",
                        "repairCode":"维修单号",
                        "hostModel":"主机型号",
                        "lendCode":"借用单号",
                        "DOAtype":"DOA类型",
                        "faultCode":"故障编码",
                        "faultName":"故障名称",
                        "conditionDescribe":"情况说明",
                        "saveAndSubmit":"保存并提交",
                        "save":"保存",
                        "cancel":"取消",
                        "DOAretest":"DOA复测步骤",
                        "stepTitle":"步骤标题",
                        "stepDescribe":"步骤说明",
                        "retestResult":"复测结果",
                        "retestDescribe":"复测说明",
                        "DOAappearImage":"DOA外观图片",
                        "imageName":"图片名称",
                        "delete":"删除",
                        "uploadImage":"上传图片"
                    },
                    en:{
                        "pleaseSelect":"pleaseSelect",
                        "pleaseImport":"pleaseImport",
                        "spareCode":"spareCode",
                        "spareName":"spareName",
                        "sequence":"sequence",
                        "operate":"operate",
                        "status":"status",
                        "signTime":"signTime",
                        "dotCode":"dotCode",
                        "dotName":"dotName",
                        "lendOrderCode":"lendOrderCode",
                        "repairOrderCode":"repairOrderCode",
                        "spareLendDetail":"spareLendDetail",
                        "DOAkeep":"DOAkeep",
                        "planClass":"planClass",
                        "productLine":"productLine",
                        "spareClass":"spareClass",
                        "addSpareDOA":"addSpareDOA",
                        "DOAcode":"DOAcode",
                        "recorder":"recorder",
                        "recordTime":"recordTime",
                        "repairDotName":"repairDotName",
                        "repairCode":"repairCode",
                        "hostModel":"hostModel",
                        "lendCode":"lendCode",
                        "DOAtype":"DOAtype",
                        "faultCode":"faultCode",
                        "faultName":"faultName",
                        "conditionDescribe":"conditionDescribe",
                        "saveAndSubmit":"saveAndSubmit",
                        "save":"save",
                        "cancel":"cancel",
                        "DOAretest":"DOAretest",
                        "stepTitle":"stepTitle",
                        "stepDescribe":"stepDescribe",
                        "retestResult":"retestResult",
                        "retestDescribe":"retestDescribe",
                        "DOAappearImage":"DOAappearImage",
                        "imageName":"imageName",
                        "delete":"delete",
                        "uploadImage":"uploadImage"
                    }
                },
                /*DOA备案*/
                dialogAddVisible:false,//新建弹窗
                addSpareDOAForm:{},//新建查询表单
                DOAretestData:[{name:"aaa"}],//DOA复测
                DOAimageData:[{name:"aaa"}],//DOA外观图片
            };
        },
        created:function(){
            this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
        },
        computed:{
            languageType(){
                return this.$store.state.languageType;
            }
        },
        watch:{
            languageType(){
                this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
            }
        },
        //进入页面立即运行此方法
        mounted: function () {
            var _this = this;
            _this.$store.commit('currentActive', 'SpareDOA');
            //ajax前后查询按钮禁用
            $(".selectAll").ajaxStart(function(){
                _this.selectDisabled=true;
            });
            $(".selectAll").ajaxStop(function(){
                _this.selectDisabled=false;
            });
        },
        methods:{
            // 选择创建开始日期
            selectedCreateTimeBegin(val){

            },
            // 选择创建结束日期
            selectedCreateTimeEnd(val){

            },
            //查询列表
            queryClick(){
                /*var _this=this;
                 _this.loading=true;
                 var urlAddress="";
                 if(this.isClickBySelect){
                     urlAddress="projectSubstitute/queryMaterialByPage";
                 }else{
                     urlAddress="projectSubstitute/queryIncreasementMaterialByPage";
                 }
                 var tmp={
                     productLineId:_this.formInline.productLineId,
                     legalPersonCode:_this.formInline.legalPersonCode,
                     startCreateTime:_this.formInline.startCreateTime,
                     endCreateTime:_this.formInline.endCreateTime,
                     materialCode:_this.formInline.materialCode,
                     materialName:_this.formInline.materialName,
                     status:_this.formInline.status,
                     pageIndex:_this.pageIndex,
                     pageSize:_this.pageSize
                 };
                 $.ajax({
                     type: 'POST',
                     url: _this.metadata_service+urlAddress,
                     cache: false,
                     data:JSON.stringify(tmp),
                     dataType:'JSON',
                     contentType: "application/json;charset=utf-8",
                     success: function (data) {
                         if (data.success) {
                             _this.loading=false;
                             _this.isPaging=true;
                             _this.totalPage=data.data.totalPage;
                             _this.totalNumber=data.data.totalNumber;
                             _this.productData=data.data.dataList;
                         }else{
                             _this.loading=false;
                            _this.common.errorTip(data.errorMessage)
                         }
                     }
                 });*/
            },
            add(){
              this.dialogAddVisible=true;
            },
        }
    }
</script>



